<div class="logs">
  <div class="table">
    <table mat-table [dataSource]="log_srv.logs().list" class="mat-elevation-z8">
      <ng-container matColumnDef="username">
        <th mat-header-cell *matHeaderCellDef>用户</th>
        <td mat-cell *matCellDef="let element"> {{ element.username }}</td>
      </ng-container>

      <ng-container matColumnDef="created_at">
        <th mat-header-cell *matHeaderCellDef>时间</th>
        <td mat-cell *matCellDef="let element"> {{ element.created_at | date: "yyyy-MM-dd HH:mm:SS" }}</td>
      </ng-container>

      <ng-container matColumnDef="type">
        <th mat-header-cell *matHeaderCellDef>日志类型</th>
        <td mat-cell *matCellDef="let element"> {{ element.type.label }}</td>
      </ng-container>

      <ng-container matColumnDef="html">
        <th mat-header-cell *matHeaderCellDef>操作</th>
        <td mat-cell *matCellDef="let element" [innerHTML]="decodeLog(element.html)"></td>
      </ng-container>

      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
      <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
    </table>
  </div>
</div>
